package com.neusoft.neu24.nep.controller;

import com.neusoft.neu24.nep.entity.ComonResult;
import com.neusoft.neu24.nep.entity.Member;
import com.neusoft.neu24.nep.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * MemberController 成名管理模块控制器
 *
 * @author Administrator
 * @version 2024/05/24 15:54
 **/
@RestController
@CrossOrigin("*")
@RequestMapping("/member")
public class MemberController {
    @Autowired
    IMemberService memberService;


    @PutMapping("/resetpwd")

    public ComonResult  resetpwd( @RequestBody Member member ){
        return  memberService.resetpwd(member);
    }


    @GetMapping("/login/m/{tel}/{smscode}")
    public  ComonResult<Member> loginm(@PathVariable("tel") String tel, @PathVariable("smscode") String smscode){
        return   memberService.loginm( tel, smscode );
    }




    @PostMapping("/register/mobile/{tel}")
    public ComonResult<Member> register(@PathVariable("tel") String tel){
        return memberService.register(tel);
    }

    /**
     * 成员模块登录接口
     * @param logid
     * @param logpwd
     * @return
     */
    @PostMapping("login")
    public ComonResult<Member> login(String logid, String logpwd){
        return memberService.login(logid, logpwd);
    }
    /**
     * 成员模块注册注册接口
     * @param member
     * @return
     */
    @PostMapping("register")
    public ComonResult<Member> register( @RequestBody Member member  ){
        return  memberService.register(member);
    }
}